<template>
	<view class="home">
		<view class="notice">
			<uni-notice-bar text="1个学生待审批" :single="true"/>
		</view>
		<view class="card" v-for="(item, index) in list" :key="index" @click="handleRegister">
			<view class="card_top">
				<img class="card_img" src="/static/homeIcon.png" alt="" />
				<view class="card_title">
					{{ item.title }}
				</view>
			</view>
			<view class="card_content">
				<view class="pd">
					假期开始时间：{{ item.startTime }}
				</view>
				<view class="pd">
					假期结束时间：{{ item.endTime }}
				</view>
				<view class="pd">
					时长：{{ item.time }}
				</view>
			</view>
			<view class="card_footer">
				<view class="left">
					<view class="icon">
						{{ item.surname }}
					</view>
					<view class="title">
						留校登记待审批
					</view>
				</view>
				<view class="right">
					同意留校
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						title: '2024年春节放假',
						startTime: '2023-11-16 00:00:00',
						endTime: '2023-11-16 23:59:59',
						time: '26',
						surname: '南'
					},
					{
						title: '2024年春节放假',
						startTime: '2023-11-16 00:00:00',
						endTime: '2023-11-16 23:59:59',
						time: '26',
						surname: '冯'
					},
					{
						title: '2024年春节放假',
						startTime: '2023-11-16 00:00:00',
						endTime: '2023-11-16 23:59:59',
						time: '26',
						surname: '王'
					},
					{
						title: '2024年春节放假',
						startTime: '2023-11-16 00:00:00',
						endTime: '2023-11-16 23:59:59',
						time: '26',
						surname: '张'
					}
				]
			}
		},
		methods: {
			handleRegister() {
				uni.navigateTo({
					url: '/pages/register/index'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	::v-deep .uni-noticebar {
		text-align: center;
	}
	.card{
		width: 88%;
		padding: 20rpx;
		margin: 20rpx auto;
		border-radius: 10rpx;
		background: #E9F1FF;
		box-shadow: 0px 0px 8rpx 0px rgba(0, 0, 0, 0.2);
		.card_top{
			display: flex;
			align-items: center;
			font-size: 28rpx;
			padding: 10rpx 0rpx;
			.card_img{
				width: 40rpx;
				height: 40rpx;
				margin-right: 16rpx;
			}
		}
	}
	.card_content{
		font-size: 24rpx;
		padding: 20rpx 0rpx;
		padding-bottom: 20rpx;
		border-bottom: 1px solid #ccc;
		color: #5D5E5D;
		.pd{
			padding: 4rpx 0rpx;
		}
	}
	.card_footer{
		padding-top: 20rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 24rpx;
		.left{
			display: flex;
			align-items: center;
			color: #686868;
			.icon{
				width: 60rpx;
				height: 60rpx;
				line-height: 60rpx;
				text-align: center;
				margin-right: 16rpx;
				background-color: #FFE9BF;
				border-radius: 50%;
				color: #FFA93F;
			}
		}
		.right{
			width: 180rpx;
			height: 60rpx;
			color: #fff;
			text-align: center;
			line-height: 60rpx;
			border-radius: 10rpx;
			background-image: linear-gradient(to right, #6AA9FF, #3C88FF, #156DFF);
		}
	}
</style>